<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        function toPage(flag){
            var pageNum = parseInt($("#pageNum").val());
            var totalPage = parseInt($("#total").val());

            if(flag == 1){ //首页
                if(pageNum <= 1){
                    alert("已经为首页");
                    return;
                }
                $("#pageNum").val(1);
            } else if(flag == 2){// 上一页
                if(pageNum <= 1){
                    alert("已经为首页");
                    return;
                }
                $("#pageNum").val(pageNum - 1);
            } else if(flag == 3){// 下一页
                if(pageNum == totalPage){
                    alert("已经是尾页");
                    return;
                }
                $("#pageNum").val(pageNum + 1);
            } else if(flag == 4){// 尾页
                if(pageNum == totalPage){
                    alert("已经是尾页");
                    return;
                }
                $("#pageNum").val(totalPage);
            }

            getInfo();//进行分页记得要改这个函数的名字
        }


        function feng(obj){
            var pageNum = obj.pageNum;
            var totalPage = obj.total;
            var pageSize = obj.pageSize;
            $("#pageNum").val(pageNum);
            $("#total").val(totalPage);
            $("#pageSize").val(pageSize);
        }
    </script>
    当前第<input type="text" id="pageNum" name="pageNum" size="1" readonly>页
    共<input type="text" id="total" name="total" size="1" readonly>页
    每页<input type="text" id="pageSize" name="pageSize" size="1">条
    <a href="javascript:toPage(1)">首页</a>
    <a href="javascript:toPage(2)">上一页</a>
    <a href="javascript:toPage(3)">下一页</a>
    <a href="javascript:toPage(4)">尾页</a>
</body>
</html>